<?php
//后台初始化

if (!defined('IN_MMOA'))
{
	die('Hacking attempt');
}

define('MMOA_ADMIN', true);

if(__FILE__ == '')
{
	die('Fatal error code: 0');
}

if (file_exists('../data/config.php'))
{
	include '../data/config.php';
}


// 获取根目录
if (!defined('ADMIN_PATH'))
{
	define('ADMIN_PATH', 'admin');
}
define('ROOT_PATH', str_replace(ADMIN_PATH . '/includes/init.php', '', str_replace('\\', '/', __FILE__)));

/* 创建  MMOA 对象 */
require ROOT_PATH . 'includes/cls_mmoa.php';
$mmoa = new MMOA($db_name, $prefix);

/* 初始化数据库类  */
require ROOT_PATH . 'includes/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db_host = $db_user = $db_pass = $db_name = NULL;

/* 创建 后台Smarty 对象   */
require ROOT_PATH . 'includes/cls_smarty.php';
$smarty = new Smarty_MMOA();
$smarty->setTemplateDir(ROOT_PATH . ADMIN_PATH . '/templates/');
$smarty->setCompileDir(ROOT_PATH . 'temp/templates_c/admin/');
$smarty->assign('TemplateAdminDir', ADMIN_PATH . '/templates/');

/* 函数库 */
require ROOT_PATH . 'includes/lib_base.php';
require ROOT_PATH . 'includes/lib_main.php';


session_start();

